<?php
$this->renderPartial('..//filterTranslate/_form');
?>
<?php $this->beginWidget('webroot.widgets.iButtonBar');?>

<?php $this->widget('bootstrap.widgets.TbButton', array(
    'label'=>Yii::t('main','Delete Translate'),
    'type'=>'danger',
	'icon'=>'ok-sign white',
    'url'=> 'javascript:void(0);',
	'htmlOptions'=>array('onclick'=>"CoreJs.deleteAll('".Yii::app()->createUrl('/translate/filterTranslate/delMulti')."','".Yii::t('app','Are you sure you want to delete item?')."')")
));?>
<?php $this->endWidget();?>
<?php

$total = BackendTranslatesModel::getTotalData($paramsTrans['language'],'tbl_content','id',"type='page'");
$page = new CPagination($total);

$page->pageSize = 20;
$curr_page = $page->getCurrentPage();
$data = BackendTranslatesModel::GetListTransNews($paramsTrans['language'],$page->getLimit(), $page->getOffset(),'page');
?>
<div class="grid-view X-igrid">
<div class="wrr-x-grid">
<table class="items itable">
<thead>
<tr>
<th width="60"><div id="sl-row" onclick="CoreJs.checkAll(this.id);" ><input type="checkbox" class="checkall" value="" /></div></th>
<th width="50"><?php echo Yii::t('app','ID')?></th>
<th><?php echo Yii::t('app','Content')?></th>
<th><?php echo Yii::t('app','Content').'&nbsp;('.$languages[$paramsTrans['language']].')'?></th>
<th width="100"><?php echo Yii::t('app','Translated')?></th>
<th><?php echo Yii::t('app','Published')?></th>
<th width="50"><?php echo Yii::t('app','ID')?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($data as $key => $value):
?>
<tr>
<td><input value="<?php echo $value['tid']; ?>" type="checkbox" name="rad_ID[]" id="rad_ID"></td>
<td><?php echo $value['id']?></td>
<td><?php echo $value['title']?>
</td>
<td>
<?php 
$Ctrans = @unserialize($value['trans_content']);
if(is_array($Ctrans) && $Ctrans["title"]!='')
	echo $Ctrans["title"];
?>
</td>
<td><?php if($value['published']!=''):?>
<img src="<?php echo Yii::app()->theme->baseUrl;?>/images/checked.png" />
<a href="<?php echo Yii::app()->createUrl('translate/filterTranslate/UpdateTrans', array('id'=>$value['id']));?>"><?php echo Yii::t('app','Edit');?></a>
<?php else:?>
<a href="<?php echo Yii::app()->createUrl('translate/filterTranslate/create', array('id'=>$value['id']))?>" class="btn btn-small btn-primary"><?php echo Yii::t('app','Translate');?></a>
<?php endif;?>
</td>
<td width="50">
<?php if($value['published']==1):?>
<img src="<?php echo Yii::app()->theme->baseUrl;?>/images/checked.png" />
<?php elseif($value['published']==0):?>
<img src="<?php echo Yii::app()->theme->baseUrl;?>/images/unchecked.png" />
<?php endif;?>
</td>
<td><?php echo $value['tid']?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
</div>
<div class="pagination">
<?php
	$this->widget('CLinkPager',
	array(
		'pages' => $page,
		'maxButtonCount'=>4
		));
	$this->widget('CListPager', array(
	    'pages'=>$page,
	));
		
?>

</div>